An NFC technology is a short-distance wireless connection technology. According to the technology, near field communication between electronic devices having NFC functions (or referred to as “NFC devices”) may be implemented by means of magnetic field sensing. In the NFC technology, an NFC controller interface (NCI) protocol mainly defines a logical interface for communication between a device host (DH) in an NFC device and an NFC controller (NFCC).
If two NFC devices performing point-to-point communication use a Logical Link Control Protocol (LLCP), it can be known according to the LLCP that, before the two NFC devices performing point-to-point communication performs upper-layer information unit exchange by means of a service (a connectionless service or a connection-oriented service), each of the two NFC devices needs to learn a service access point (SAP) that is allocated by the other NFC device for the service. If one of the NFC devices does not learn an SAP that is allocated by the other NFC device for the service, the NFC device needs to learn, by means of a service discovery procedure (SDP), the SAP that is allocated by the other NFC device for the service.
According to the existing NCI protocol, after one of the NFC devices receives a Logical Link Control protocol data unit (LLC PDU) sent by the other NFC device at a peer end, an NFCC of the NFC device needs to forward the LLC PDU to a DH, so that the DH performs processing and makes a reply, and then sends the reply of the DH to the peer end. In a service discovery procedure, for example, each time one of the NFC devices receives a service name lookup protocol data unit (SNL PDU) including a service discovery request (SDREQ) or a connect protocol data unit (CONNECT PDU) including a service name (SN), an NFCC of the NFC device needs to forward the PDU to a DH, waits for a reply made by the DH, and then feeds back the reply to a peer end by using the NFCC. Multiple interactions between the NFCC and the DH in the service discovery procedure cause relatively high resource overheads.